package net.news.entity;
// default package

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * NewsPeople entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="NewsPeople"
    ,schema="dbo"
    ,catalog="CMUNEWS"
)

public class NewsPeople  implements java.io.Serializable {


    // Fields    

     private Integer id;
     private String name;
     private String psw;
     private String email;
     private Integer popleType;
     private Set<News> newses = new HashSet<News>(0);


    // Constructors

    /** default constructor */
    public NewsPeople() {
    }

	/** minimal constructor */
    public NewsPeople(String name, String psw, Integer popleType) {
        this.name = name;
        this.psw = psw;
        this.popleType = popleType;
    }
    
    /** full constructor */
    public NewsPeople(String name, String psw, String email, Integer popleType, Set<News> newses) {
        this.name = name;
        this.psw = psw;
        this.email = email;
        this.popleType = popleType;
        this.newses = newses;
    }

   
    // Property accessors
    @Id @GeneratedValue
    
    @Column(name="id", unique=true, nullable=false)

    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
    
    @Column(name="name", nullable=false, length=50)

    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    @Column(name="psw", nullable=false, length=50)

    public String getPsw() {
        return this.psw;
    }
    
    public void setPsw(String psw) {
        this.psw = psw;
    }
    
    @Column(name="email", length=200)

    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    @Column(name="popleType", nullable=false)

    public Integer getPopleType() {
        return this.popleType;
    }
    
    public void setPopleType(Integer popleType) {
        this.popleType = popleType;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="newsPeople")

    public Set<News> getNewses() {
        return this.newses;
    }
    
    public void setNewses(Set<News> newses) {
        this.newses = newses;
    }
   








}